fix: UI uses translated keys if available#1290
Open
Math-Bee wants to merge 9 commits intoTagStudioDev:mainfrom
Open
fix: UI uses translated keys if available#1290Math-Bee wants to merge 9 commits intoTagStudioDev:mainfrom
Math-Bee wants to merge 9 commits intoTagStudioDev:mainfrom
Conversation
Fixes bug where the thumbnail size combobox options don't get translated
This comment was marked as resolved.
This comment was marked as resolved.
Properly uses the translation keys for the setting options, in a very similar way to the thumbnail options Fun Fact: this was already fixed in TagStudioDev#945, but got unfixed in TagStudioDev#1077. The comment was left behind, so I tidied that up too
imo this looks worse because the spacing isn't consistent, but whatever
Fixes the color placeholder, the "all tags" in tag search, and the description of the folder to tags macro not being translated These ones are all 1 or 2 line fixes
The dialogs now have translated keys for all of their text. This does change a couple things: - Deleting tags is a Warning message now, like deleting fields - The 2 buttons for the field deletion dialog have swapped positions - The "OK" button on the deleting tags dialog now uses the `generic.remove` key to be similar to deleting fields - Deleting fields uses Standard Buttons (like deleting tags) because whatever it was doing previously was unnecessarily confusing
still using Standard Buttons. the main reason for switching is that it's a bit weird to work with Button Roles & that Button Roles aren't needed to do this
discard should be better since it's closer to the actual action
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The settings dropdowns, thumbnail size options, and "all tags" tag search setting now get their translated text during
.addItem:The language is changed within
ts_qt's__init__()function, but class definitions are executed when the file's imported; This means that if a translation is defined in a class definition (or outside any class/function), it uses the default language (english) rather than the correct language.The translation variable definitions could have been moved inside the
__init__()function of their class, but because they're not used by anything other than their comboboxes, it's simpler & more space efficient to just directly add them to their comboboxThe deleting tags dialog is now a warning to match the deleting fields dialog, & uses the
DiscardStandardButtoninstead of theOkone. The deleting fields dialog now usesStandardButtons instead ofButtonRoles for simplicity:The
exec()function doesn't return the button'sButtonRoles' value, it returns a value that depends on when you add the button; This wasn't super clear, especially since the statement that checks what button was pressed compares the result withButtonRole.ActionRole.value, which only worked because it equals3, and the correct button was the 2nd button added. The sort of button-checking implied by the code only actually works if you useStandardButtons, which is why it uses them now.The color placeholder, the description of the folders to tags macro, and the deleting files dialog just needed to swap the explicit text for translated text.
Closes #1316.
Tasks Completed